package com.plan
/**
 * The Workplan entity.
 *
 * @author  michael.geng  mokesoft
 *
 *
 */
class Workplan {
    static mapping = {
         table 'pm_workplan'
         // version is set to false, because this isn't available by default for legacy databases
         version true
         id generator:'identity', column:'ID'
    }
    Long id
    String creater
    Date dateCreated
    Date lastUpdated
    String planTitle
    String remark
    Integer status
    String str1
    String str2
    String workContent
    String workResult
    String worker
		Date startDate
		Date endDate

    static hasMany = [details:WorkplanDetail]
    static constraints = {
        creater(size: 0..30)
        dateCreated()
        lastUpdated()
        planTitle(size: 1..255, blank: false)
        remark()
        status(nullable: true, max: 2147483647)
        str1(size: 0..30)
        str2(size: 0..30)
        workContent(size: 0..255)
        workResult(size: 0..255)
        worker()
        str1(nullable: true)
        str2(nullable: true)
        startDate()
        endDate()
    }
    String toString() {
        return "${planTitle}"
    }
}
